<?php
class Site_Form_SiteMove extends Promotor_Form_Scaffold {

	public function init() {
		$this->setMethod('post');
		$this->setAttrib('enctype', Zend_Form::ENCTYPE_MULTIPART);

		$this->addPrefixPath('Promotor_Form_Decorator_','Promotor/Form/Decorator', self::DECORATOR);

        $subForm = $this->_getMoveForm();
        $this->addSubForm($subForm, 'movetab');
	}

	/**
     * @return Zend_Dojo_Form_SubForm
     */
	protected function _getMoveForm() {
    	$subForm = new Zend_Form_SubForm();
        $subForm->setAttribs(array(
            'name'   => 'movetab',
            'legend' => 'Zmiana położenia strony',
        ));

        $subForm
        	->addElement(new KontorX_Form_Element_Db_SelectTree('movePk', array(
        		'label' => 'Gdzie przenieś stronę',
        		'required'  => false,
        		'dbTable' => 'Site_Model_DbTable_Site',
        		'optionKey'  => 'id',
        		'optionValue'  => 'name',
        		'firstNull' => true
        	)));

        return $subForm;
    }
}